<template>
    <div>
{{ str }}---------{{ num }}
<button v-on:click="add(2)">+2</button>
<button @click="sub($event)">-1</button>
<a v-bind:href="url" target="_blank">{{ name }}</a>
<img :src="imgUrl"/>
    </div>
</template>
<script setup>
import {ref} from 'vue'
let num = ref(10)
let str = 'hello'

let name = ref('百度一下')
let url = ref('https://www.baidu.com')
let imgUrl = ref('https://img0.baidu.com/it/u=484472052,3072925589&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800')
function add(a) {
    num.value+=a
}

let sub = (e)=>{
    console.log(e);
    num.value--
}
</script>
<style scoped>
</style>